<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景图片</title>
    <style>
        .div1 {
            width: 300px;
            height: 200px;
            border: 1px solid red;
            background-image: url('../1.png');
            /* 背景图片的大小，可以填单词或者具体尺寸 */
            background-size: contain;
            /* 是否重复，默认重复 */
            background-repeat: no-repeat;
            /* 背景图片的位置，可以填单词或者具体坐标 */
            background-position: center;
        }
        .index {
            display: inline-block;
            width: 65px;
            height: 50px;
            background-image: url('img/index.png');
            background-size: contain;
        }
        .cate {
            display: inline-block;
            width: 65px;
            height: 50px;
            background-image: url('img/cate.png');
            background-size: contain;
        }
    </style>
</head>
<body>
    <div class="div1"></div>
    <hr>
    <span class="index"></span>
    <span class="cate"></span>
</body>
</html>